﻿using System;
using System.Collections.Generic;
using System.Text;

namespace DPortAck.ObjectModel
{
    public class MachineConnectionTestResult : TestResult
    {
        private MachineConnectionTest _test;
        private List<MachinePortConnectionTestResult> _portTestsResults;

        public MachineConnectionTest Test
        {
            get { return _test; }
        }

        public MachineConnectionTestResult(MachineConnectionTest test)
        {
            _test = test;
        }

        public void AddTestResult(MachinePortConnectionTestResult portTestResult)
        {
            if (portTestResult == null)
                throw new ArgumentNullException("portTestResult");

            if (_portTestsResults == null)
                _portTestsResults = new List<MachinePortConnectionTestResult>();

            _portTestsResults.Add(portTestResult);
        }

        public MachinePortConnectionTestResult[] GetResults()
        {
            return (_portTestsResults != null) ? _portTestsResults.ToArray() : null;
        }
    }
}
